package com.tiny.factory.pizzaaf.pizzas;

import com.tiny.factory.pizzaaf.ChicagoPizzaIngredientFactory;
import com.tiny.factory.pizzaaf.PizzaIngredientFactory;

/**
 * Created by zhumenglong on 2017/4/3.
 */
public class ChicagoPizzaStore extends PizzaStore {

    protected Pizza createPizza(String item) {
        Pizza pizza = null;
        PizzaIngredientFactory ingredientFactory =
                new ChicagoPizzaIngredientFactory();

        if (item.equals("cheese")) {

            pizza = new CheesePizza(ingredientFactory);
            pizza.setName("芝加哥风味起司披萨");

        } else if (item.equals("veggie")) {

            pizza = new VeggiePizza(ingredientFactory);
            pizza.setName("芝加哥风味蔬菜披萨");

        } else if (item.equals("clam")) {

            pizza = new ClamPizza(ingredientFactory);
            pizza.setName("芝加哥风味蛤蜊披萨");

        } else if (item.equals("pepperoni")) {

            pizza = new PepperoniPizza(ingredientFactory);
            pizza.setName("芝加哥风味腊香肠披萨");

        }
        return pizza;
    }
}
